<?php
if ( !defined('KAIZEKU') ) {die( 42);}
/**
 * WP-iStalker Chrome Min 
 * links
 * 
 * PHP 4 & 5
 * 
 * @package		WordPress
 * @subpackage	wp-istalker-chrome-min
 * 
 * @author		Avice (ChaosKaizer) De'vereux <ck+wp-istalker-min@istalker.net>
 * @author		NH. Noah <noah+wp-istalker-min@kakkoi.net>
 * @copyright 	2007 - 2009 Avice De'vereux, NH. Noah
 * @license 	http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License v2 
 * @version 	CVS: $Id: links.php 13 2009-01-11 15:22:40Z chaoskaizer $
 * @since 		0.1
 */


/**
 * wpi_get_stylesheet_url()
 * Output theme stylesheet url
 *  
 * @param	mixed|array	$stylesheets	array of css
 * 										filename without the extensions name
 * @return string stylesheet url
 * @since 0.1
 *  
 */
function wpi_get_stylesheet_url($stylesheets=false){
	
	$output = array();
	
	if (!has_count($stylesheets)){
		global $Wpi;
		$stylesheets = $Wpi->Client->Style->css;	
	}
	
	foreach($stylesheets as $css) $output[] = $css.'.css';
	
	unset($stylesheets,$css);
	
	$output = wpiStyle::relativeUrl(array_str($output));
	
	return apply_filters(wpiFilter::STYLESHEET_URL,$output);	
}


/**
 * void wpi_get_body_id()
 * return body ID
 *  
 * @since 0.1
 */
function wpi_get_body_id(){ 
	
	return (string) strtr(WPI_HOME_URL,array('http://'=>'','.'=>'-','/'=>'-') );
}

/**
 * void wpi_get_pages_link();
 * Pages menu
 * 
 * @since 1.2
 */
function wpi_get_pages_link(){
	
	$options = 'link_before=<span>&link_after=</span>&sort_column=menu_order&title_li=&echo=';	
	//$exclude = wpi_option('menu_page_exclude');
	$home = get_option('home');
	$relative = wp_make_link_relative($home);
	
	//if ($exclude && !empty($exclude)){
		//$options .='&exclude='.$exclude;
	//}
	
	$output = wp_list_pages($options);
	$output = strtr($output,array($home=>$relative));	
	
	$extra_pages = '';
	

		
	$htm = _t('a',__('Home',WPI_META), array(
			'href'=> wp_make_link_relative(WPI_HOME_URL_SLASHIT),
			'rel'=>'home',
			'title' => WPI_BLOG_NAME));
		
	$attribs = array('class'=>'page_item page_home');
		
		if (is_home() || is_front_page() && !is_paged()){
			$attribs['class'] = $attribs['class'].' current_page_item';
		}
		
	$htm = _t('li',$htm,$attribs );
	
	$extra_pages .= $htm;	
	
	
	if (is_single()){
		
		$label = __('Article',WPI_META);
		
		$htm = _t('a',$label, array(
			'href'=> '#iscontent',
			'class'=>'scroll-to',
			'title' => __('Skip to content',WPI_META)));
		$htm = 	_t('li',$htm,array('class'=>'page_item page_single current_page_item') );
		
		$extra_pages .= $htm;				
	}	
	
	$output = $extra_pages. $output;
	
	return $output;	
}
?>